﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="card_add.aspx.cs" Inherits="WebSite.admin.product.card_add" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>福利点点通 </title>
    <link href="../css/skin.css" rel="stylesheet" type="text/css" />
    <script src="../js/common.js" type="text/javascript"></script>
      
</head>
<body>
    <form id="form1" runat="server">
     <ext:PageManager ID="PageManager1" runat="server" />
           <ext:SimpleForm ID="extForm1" runat="server" BodyPadding="5px"   
            EnableBackgroundColor="false" Title="开卡管理"  ShowHeader="true" >
              <Items>
              <ext:NumberBox id="nbxCardPoits" runat="server" Label="礼品卡福点数" NoDecimal="true"  Width="200px" Required="true"  MaxValue="100000"   NoNegative="True"  ShowRedStar="true" MinValue="1"></ext:NumberBox>
                  <ext:NumberBox id="txtBeforNumber" runat="server" Label="卡起始号" NoDecimal="true"  Width="200px" Required="true"  MaxValue="10000000000"   NoNegative="True" ShowRedStar="true"  MinValue="1000"></ext:NumberBox>
                  <ext:NumberBox id="txtCardPassCount" runat="server" Label="卡密位数" NoDecimal="true"  Width="200px" Required="true"  MaxValue="16"   NoNegative="True" ShowRedStar="true"  MinValue="1"></ext:NumberBox>
                   <ext:DatePicker ID="dpkStartTime" Width="100px"   Label="开始日期" Required="true" ShowRedStar="true" runat="server">
                   </ext:DatePicker>
                   <ext:DatePicker ID="dpkEndTime" Width="100px" CompareControl="dpkStartTime"
                CompareOperator="GreaterThan" CompareMessage="截止日期应该大于开始日期！"     Label="截止日期" Required="true" ShowRedStar="true" runat="server">
                   </ext:DatePicker>
                   <ext:DropDownList ID="ddlPublichWay" Label="发行方式" Width="200px" Required="true" ShowRedStar="true" runat="server">
                      <ext:ListItem Text="卡券" Value="卡券" Selected="true" />
                      <ext:ListItem Text="电子券" Value="电子券" />
                   </ext:DropDownList>
                 <ext:RadioButtonList ID="rbtlUseWay" runat="server" Label="使用方式" Width="200px">
                    <ext:RadioItem Text="专用" Value="1" Selected="true" />
                    <ext:RadioItem Text="通用" Value="0" />
                 </ext:RadioButtonList>

                   <ext:DropDownList ID="ddlCardType" Label="礼品卡类别"  CompareType="String" CompareValue="-1"
                CompareOperator="NotEqual"  Width="200px" Required="true" ShowRedStar="true" runat="server">
                   </ext:DropDownList>
                   <ext:textbox ID="txtCount"  Label="礼品卡数量" Width="200px"  Required="true" 
                        ShowRedStar="true" runat="server" Text=""></ext:textbox>
                   <ext:DropDownList ID="ddlCompany" Label="商家" Width="200px"   CompareType="String" CompareValue="-1"
                CompareOperator="NotEqual" Required="true" ShowRedStar="true" runat="server">
                   </ext:DropDownList>
                  
               </Items>
              </ext:SimpleForm>   

            <ext:Panel ID="Panel8" ShowBorder="True" ShowHeader="false" BoxFlex="1"  CssClass="x-form-item"  Layout="Fit"
                runat="server">
                <Toolbars>
                    <ext:Toolbar ID="Toolbar2" runat="server">
                        <Items>
                    <ext:Button ID="btnGenerateCard" runat="server" Text="生成卡券"  ValidateForms="extForm1" ConfirmText="只是临时生成，并没有保存到数据库！"
                       OnClick="btnGenerateCard_Click"></ext:Button>
                   <ext:ToolbarSeparator ID="ToolbarSeparator2" runat="server"> </ext:ToolbarSeparator>
                   <ext:Button ID="btnExportCard" runat="server" Text="导出卡券" OnClick="btnExportCard_Click1" ></ext:Button>
                   <ext:ToolbarSeparator ID="ToolbarSeparator1" runat="server"> </ext:ToolbarSeparator>
                   <ext:Button ID="btnCardDatabase" runat="server" Text="写入数据库" OnClick="btnCardDatabase_Click" 
                    ConfirmTarget="self" ConfirmText="确定导出过以上卡券吗？确定要把这些卡券存入库吗？" >
                    </ext:Button>
              
                        </Items>
                    </ext:Toolbar>
                </Toolbars>
                <Items>
    </Items>
    </ext:Panel>
         <ext:Grid ID="Grid1" Title="查询结果" ShowBorder="false"  CssClass="x-form-item"  Height="500px"  AllowPaging="false" SortColumn="cardcode" SortDirection="ASC"     
                         ShowHeader="False" runat="server" EnableCheckBoxSelect="false"   AllowSorting="true"    IsDatabasePaging="true" 
                        DataKeyNames="cardid"  EnableRowNumber="True">

        <Columns>
        
            <ext:BoundField Width="100px" ColumnID="cardcode" SortField="cardcode" DataField="cardcode" DataFormatString="{0}"
                HeaderText="卡 号" />
           <ext:BoundField Width="100px" ColumnID="CardTypeName" SortField="CardTypeId" DataField="CardTypeName" DataFormatString="{0}"
                HeaderText="礼品卡类别" />
            <ext:BoundField Width="100px" ColumnID="SPublishWay" SortField="SPublishWay" DataField="SPublishWay" DataFormatString="{0}"
                HeaderText="发行方式" />
             <ext:BoundField Width="100px" ColumnID="UseWay" SortField="UseWay" DataField="UseWay" DataFormatString="{0}"
                HeaderText="使用方式" />
                   <ext:BoundField Width="100px" ColumnID="cardprice" SortField="cardprice" DataField="cardprice" DataFormatString="{0}"
                HeaderText="福点数" />

                <ext:BoundField Width="100px" ColumnID="StartTime" SortField="StartTime" DataField="StartTime" DataFormatString="{0:yyyy-MM-dd}"
                HeaderText="开始日期" />
                 <ext:BoundField Width="100px" ColumnID="endtime" SortField="endtime" DataField="endtime" DataFormatString="{0:yyyy-MM-dd}"
                HeaderText="截止日期" />
                  

        </Columns>
    </ext:Grid>


 
    </form>
</body>
</html>
